package com.jianyi.model;

import java.util.Date;

import com.jfinal.plugin.activerecord.Model;
import com.jianyi.util.UUIDUtils;

public class SysLog extends Model<SysLog>{

	private static final long serialVersionUID = -4534974131377911710L;
	public static final SysLog dao = new SysLog();
	
	public static final String SYSTEM_SETTINGS_EDIT="SYSTEM_SETTINGS_EDIT";
	
	public void add(String creator,String username,String operation,String logType,String dataId){
		SysLog sysLog=new SysLog();
		Date now=new Date();
		sysLog.set("id", UUIDUtils.getUUID());
		sysLog.set("createTime", now);
		sysLog.set("creator", creator);
		sysLog.set("username", username);
		sysLog.set("operation", operation);
		sysLog.set("logType", logType);
		sysLog.set("dataId", dataId);
		sysLog.save();
	}
	
	public void add(String operation,String logType,String dataId){
		SysLog sysLog=new SysLog();
		Date now=new Date();
		sysLog.set("id", UUIDUtils.getUUID());
		sysLog.set("createTime", now);
		sysLog.set("operation", operation);
		sysLog.set("logType", logType);
		sysLog.save();
	}
}
